package com.compunit.composite.core.interfaces.cx;

/**
 * <code>ICxMapping</code> defines the interface of a
 * data structure that represents a cx mapping tag
 * definition. It contains a single fully qualified
 * interface name representing the provided or required
 * interface, and a list of fully qualified class names
 * of concrete implementations that provide or require
 * the interface.
 *
 * @author Yi Wang (Neakor)
 * @version Creation date: 11-16-2009 16:23 EST
 * @version Modified date: 11-16-2009 16:31 EST
 */
public interface ICxMapping {

	/**
	 * Add the given fully qualified class name to
	 * this provided/required tag as an implementation
	 * that maps to the interface.
	 * <p>
	 * This method automatically excludes duplicates.
	 * @param classname The <code>String</code> fully
	 * qualified class name.
	 */
	public void addClass(final String classname);

	/**
	 * Remove the given fully qualified class name from
	 * this provided/required tag.
	 * @param classname The <code>String</code> fully
	 * qualified class name.
	 */
	public void removeClass(final String classname);

	/**
	 * Set the fully qualified interface name of this
	 * provided/required tag.
	 * @param interfacename The <code>String</code>
	 * fully qualified interface name.
	 */
	public void setInterface(final String interfacename);
	
	/**
	 * Set if this mapping is a provided or required
	 * mapping.
	 * @param provided The <code>Boolean</code>
	 * indicating if this mapping is a provided mapping.
	 * <code>true</code> if it is a provided mapping.
	 * <code>false</code> if it is a required mapping.
	 */
	public void setProvided(final boolean provided);
	
	/**
	 * Retrieve the fully qualified interface name of
	 * this provided/required tag.
	 * @return The <code>String</code> fully qualified
	 * interface name.
	 */
	public String getInterface();
	
	/**
	 * Retrieve all the fully qualified class names of
	 * the implementations that map to the interface.
	 * @return The <code>Iterable</code> of fully qualified
	 * <code>String</code> class names.
	 */
	public Iterable<String> getClasses();
	
	/**
	 * Check if this mapping is a provided mapping.
	 * @return The <code>Boolean</code> indicating if
	 * this mapping is a provided mapping. <code>true</code>
	 * if it is a provided mapping. <code>false</code>
	 * if it is a required mapping.
	 */
	public boolean isProvided();
}
